<?php // no direct access
defined('_JEXEC') or die('Restricted access'); 
?>

<div id="gallery">

<div>
<div id="collections-detail-title"><h3><?= $this->results->artist_name; ?></h3>
<div id="collections-detail-date-bio"><a id="enlarge-collection" href="<?= $this->results->lightbox_link; ?>" class="thickbox enlarge show-slideshow">Enlarge</a><?= $this->results->artist_date.' '.$this->results->bio_link; ?>&nbsp;</div>
<div id="collections-container-detail">
<div id="collections-preview-image">
	<a href="<?= $this->results->lightbox_link; ?>" class="thickbox show-slideshow"><img src="<?= $this->results->preview_image; ?>" alt="<?= $this->results->stripped_title; ?>" title="<?= $this->results->stripped_title; ?>" /></a>
	<p id="caption"><?= $this->results->insitution.$this->results->caption; ?></p>
</div>
<div id="collections-prev-next-thumbs">

<?php
if ($this->results->single_view_only == false) { 
	echo '<p id="more-works">' . $this->results->more . '</p>';
}

// Only want slideshow option to appear if we have more than one result
// and we're not in single view
if (($this->results->total_results > 1) && ($this->results->single_view_only == false)) {  
		echo '<a href="' . $this->results->lightbox_link . ' " class="thickbox slideshow collections-view-as-slideshow show-slideshow-with-start">VIEW AS SLIDESHOW</a>';
}


// Don't want the prev-next thumbs to show if there is only one result
if (($this->results->single_view_only == false) && ($this->results->total_results > 1)) {
		echo '<div id="thumbnails-next-previous">' . $this->results->thumbs . '</div>';
}


?>

<div id="collections-more-works"><?= $this->results->more_works; ?></div>
</div>
<div id="essay"><?= $this->results->essay; ?></div>
</div>
</div>
<div id="full-image" class="full-image-hidden">
<div id="slideshow-loader"><img src="/templates/guggenheim/images/ajax-loader.gif" /></div>
<div id="piece-container">

<?php
// Hidden inline content for lightbox: 
// if we're in highlight mode or we only have 1 result, then no flash will load, 
// so we have to put lightbox content directly into page
if (($this->results->single_view_only == true) || ($this->results->total_results == 1)) {
?>

	<h2 id="image-artist-name"><?= $this->results->artist_name; ?></h2>
	<img id="full-image-img" src="<?= $this->results->fullsize_image; ?>" alt="<?= $this->results->stripped_title; ?>" title="<?= $this->results->stripped_title; ?>" />
	<p id="image-caption"><?= $this->results->caption; ?></p>
<? } // end on-page lightbox content ?>

	<div id="slideshow-flash-push"></div>
</div>

<?php
// If not in highlight view
if (($this->results->total_results > 1) && ($this->results->single_view_only == false)) {
	$qs = 'page=' . $this->results->page_number . '&from_which=collections&f=' 
		. rawurlencode($this->results->search_field) . '&search=' 
		. urlencode($this->results->search_value);
	$flash_vars = 'xml_url=' . urlencode(G_COLLECTIONS_XML_FOR_FLASH . '/thumbs/') 
				. '&start_at=' . $this->results->current_record .'&' . $qs;
?>
<div id="slideshow-flash">To view this section, you must have Flash Player Version 8 installed on your machine. <a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">Click Here</a> to update your Flash Player. Once you have installed the latest Flash Player, you will need to quit your browser and relaunch it to the Guggenheim website.</div>
			
	<script type="text/javascript">
	  ids.flash.add('slideshow-flash', {
		movie: '/templates/guggenheim/flash/slideshow.swf?PreventCache=<?= rand(1, 500000); ?>',
		id: 'slideshow',
		width: '491', 
		height: '112',
		quality: 'high', 
		wmode: 'opaque', 
		bgcolor: '#ffffff', 
		version: '8',
		className: "fr",
		allowScriptAccess: "always",
		flashvars: "<?= $flash_vars; ?>"
	
	}, true);
	</script>	
<?php
// If there is only one image or we're in highlight view, then we need to 
// set this global js variable so the lightbox innerHTML does not get emptied
} else {
?>

<script type="text/javascript">dontClearCollectionsLightbox=true;</script>
<? } ?>

</div>

</div>
</div>

